package com.lemurian.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Type;

import com.lemurian.entity.utils.DefaultPersistence;

@Entity
@Table(name="tb_certificate")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@BatchSize(size=1000)
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Certificate extends DefaultPersistence implements Serializable {

	private static final long serialVersionUID = 1L;

	private String name;
	private String number;
	private String reqion;
	private String village;
	
	@Column(length=1,name="is_declined",nullable=false)
	@Type(type="true_false")
	private boolean declined;
	
	@ManyToOne()
	@JoinColumn(name="type_id")
	private Category type;
	
	@ManyToOne()
	@JoinColumn(name="remarks_id")
	private Category remarks;
	
	@ManyToOne()
	@JoinColumn(name="client_id")
	private Client client;
	
	@Column(name="name", length=45)
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	@Column(name="number", length=45)
	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	@Column(name="region", length=45)
	public String getReqion() {
		return reqion;
	}

	public void setReqion(String reqion) {
		this.reqion = reqion;
	}

	@Column(name="village", length=45)
	public String getVillage() {
		return village;
	}

	public void setVillage(String village) {
		this.village = village;
	}

	public boolean isDeclined() {
		return declined;
	}

	public void setDeclined(boolean declined) {
		this.declined = declined;
	}

	public Category getType() {
		return type;
	}

	public void setType(Category type) {
		this.type = type;
	}

	public Category getRemarks() {
		return remarks;
	}

	public void setRemarks(Category remarks) {
		this.remarks = remarks;
	}

	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}
}
